package org.jeecg.modules.demo.ipds.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.jeecg.modules.demo.ipds.entity.vo.SpecKeyValueDO;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.List;

/**
 * @Description: 位复用组
 * @Author: jeecg-boot
 * @Date:   2024-03-11
 * @Version: V1.0
 */
@Data
@TableName("bit_list_reuse")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="bit_list_reuse对象", description="位复用组")
@NoArgsConstructor
@AllArgsConstructor
public class BitListReuse implements Serializable {
    private static final long serialVersionUID = 1L;

	/**id*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "id")
    private java.lang.String id;
	/**创建人*/
    @ApiModelProperty(value = "创建人")
    private java.lang.String createBy;
	/**创建日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private java.util.Date createTime;
	/**更新人*/
    @ApiModelProperty(value = "更新人")
    private java.lang.String updateBy;
	/**更新日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private java.util.Date updateTime;
	/**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private java.lang.String sysOrgCode;
	/**字节ID*/
	@Excel(name = "字节ID", width = 15)
    @ApiModelProperty(value = "字节ID")
    private java.lang.String byteId;
	/**注释*/
	@Excel(name = "注释", width = 15)
    @ApiModelProperty(value = "注释")
    private java.lang.String annotation;
	/**起始位*/
	@Excel(name = "起始位", width = 15)
    @ApiModelProperty(value = "起始位")
    private java.lang.Integer startBit;
	/**默认值*/
	@Excel(name = "默认值", width = 15)
    @ApiModelProperty(value = "默认值")
    private java.lang.String defaultValue;
	/**位长度*/
	@Excel(name = "位长度", width = 15)
    @ApiModelProperty(value = "位长度")
    @JsonProperty("length")
    private java.lang.String bitLength;
//	/**复用字段*/
//	@Excel(name = "复用字段", width = 15)
//    private transient java.lang.String reuseFieldString;
//
//    private byte[] reuseField;

    public BitListReuse(BitList bitList, String byteReuse,String reuse_id) {
        this.bitName=bitList.getBitName();
        this.bitLength=bitList.getBitLength();
        this.startBit=bitList.getStartBit();
        this.endBit=bitList.getEndBit();
        this.annotation=bitList.getAnnotation();
        this.byteId = byteReuse;
        this.defaultValue=bitList.getDefaultValue();
        this.resolutionRatio =bitList.getResolutionRatio();
        this.extendField = bitList.getExtendField();
        this.indexSx= bitList.getIndexSx();
        this.unit=bitList.getUnit();
        this.reuseId=reuse_id;
        this.valueScope=bitList.getValueScope();
        this.resolutionRatioLength =bitList.getResolutionRatioLength();
        this.tableType=bitList.getTableType();
    }


	/**终止位*/
	@Excel(name = "终止位", width = 15)
    @ApiModelProperty(value = "终止位")
    private java.lang.Integer endBit;
	/**单位*/
	@Excel(name = "单位", width = 15)
    @ApiModelProperty(value = "单位")
    private java.lang.String unit;
	/**位名称*/
	@Excel(name = "位名称", width = 15)
    @ApiModelProperty(value = "位名称")
    @JsonProperty("name")
    private java.lang.String bitName;
	/**数值范围*/
	@Excel(name = "数值范围", width = 15)
    @ApiModelProperty(value = "数值范围")
    private java.lang.String valueScope;
	/**分辨率*/
	@Excel(name = "分辨率", width = 15)
    @ApiModelProperty(value = "分辨率")
    private java.lang.String resolutionRatio;
    /**扩展字段*/
    @Excel(name = "扩展字段", width = 15)
    @ApiModelProperty(value = "扩展字段")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<SpecKeyValueDO> extendField;
	/**复用组ID*/
	@Excel(name = "复用组ID", width = 15)
    @ApiModelProperty(value = "复用组ID")
    private java.lang.String reuseId;
	/**顺序*/
	@Excel(name = "顺序", width = 15)
    @ApiModelProperty(value = "顺序")
    private java.lang.Integer indexSx;


    @ApiModelProperty(value = "分辨率最大长度")
    private  Integer resolutionRatioLength;

    @ApiModelProperty
    private String tableType;

}
